<?php
declare (strict_types=1);

namespace app\api\validate;

use think\Validate;

class VillageBusiness extends Validate
{
    protected $rule = [
        "logo"                   => "require",
        "title"                  => "require",
        "contacts"               => "require",
        "mobile"                 => "require",
        "customer_tel"           => "require",
        "province_id"            => "require",
        "city_id"                => "require",
        "district_id"            => "require",
        "address_details"        => "require",
        "return_contacts"        => "require",
        "return_mobile"          => "require",
        "return_province_id"     => "require",
        "return_city_id"         => "require",
        "return_district_id"     => "require",
        "return_address_details" => "require",
        "bank_name"              => "require",
        "bank_open"              => "require",
        "bank_account"           => "require",
        "bank_number"            => "require"
    ];

    protected $message = [
        'logo.require'                   => '请上传图片',
        'title.require'                  => '请填写店铺名称',
        'contacts.require'               => '请填写联系人',
        'mobile.require'                 => '请填写联系方式',
        'customer_tel.require'           => '请填写客服电话',
        'province_id.require'            => '请选择省',
        'city_id.require'                => '请选择市',
        'district_id.require'            => '请选择区',
        'address_details.require'        => '请填写详细地址',
        'return_contacts.require'        => '请填写收货人',
        'return_mobile.require'          => '请填写联系方式',
        'return_province_id.require'     => '请选择省',
        'return_city_id.require'         => '请选择市',
        'return_district_id.require'     => '请选择区',
        'return_address_details.require' => '请填写详细地址',
        'bank_name.require'              => '请选择银行',
        'bank_open.require'              => '请填写开户行',
        'bank_account.require'           => '请填写银行户名',
        'bank_number.require'            => '请填写银行卡号'
    ];

    protected $scene = [
        'logo'         => ['logo'],
        'title'        => ['title'],
        'contacts'     => ['contacts', 'mobile'],
        'customer_tel' => ['customer_tel'],
        'full_address' => ['province_id', 'city_id', 'district_id', 'address_details'],
        'return'       => ['return_contacts', 'return_mobile', 'return_province_id', 'return_city_id', 'return_district_id', 'return_address_details'],
        'bank'         => ['bank_name', 'bank_open', 'bank_account', 'bank_number'],
    ];
}
